const path = require('path');
const baseConfig = require('./base.js');
const webpackMerge = require('webpack-merge');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const webpack = require('webpack')

const mainConfig = {
  entry: {
    electron: path.resolve(__dirname, '../electron/main/index'),
    preload: path.resolve(__dirname, '../electron/preload/index'),
  },
  target: 'electron-main',
  output: {
    filename: '[name].js',
    path: path.resolve(__dirname, '../dist'),
  },
  devtool: 'inline-source-map',
  mode: 'development',
  plugins: [
    new CleanWebpackPlugin(),
    new webpack.DefinePlugin({
      __dirname: '__dirname',
    }),
  ]
};

module.exports = webpackMerge.merge(baseConfig, mainConfig);
